﻿using JinJun.YShowReception.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;

namespace JinJun.YShowReception.Web.Models
{
    public class UserInfoContext //管理下上文类
    {

        /// <summary>
        /// 静态上下文类
        /// </summary>
        public static UserInfoContext userInfoContext = new UserInfoContext();

        //会话的key
        private string SessionKey = "ADMININFO_KEY";

        //会话状态
        public HttpSessionState httpSessionState => HttpContext.Current.Session;

        //管理信息
        public UserInfo UserInfo
        {
            get
            {
                return httpSessionState[SessionKey] as UserInfo;
            }
            set
            {
                httpSessionState[SessionKey] = value;
            }
        }
    }
}